using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace SunshineFarmWord
{
    public class GridParentUI : MonoBehaviour
    {
        [field: SerializeField, Header("农作物数据")]
        private CultivateSO cultivateData;
        [field: SerializeField, Header("农作物格子")]
        private GridPlanteUI grid;
        void Awake()
        {
            InitGrid();
        }
        void Start()
        {
        }

        void Update()
        {
        }

        public void InitGrid()
        {
            List<CultivateSO.CultivateItemData> cultivateList = cultivateData.cultivateList;
            Debug.Log(cultivateList.Count);
            foreach (CultivateSO.CultivateItemData item in cultivateList)
            {
                GridPlanteUI gridPlante = Instantiate(grid);
                gridPlante.InitGrid(item);
                gridPlante.transform.SetParent(transform);
            }
        }
    }
}
